home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Group 42-Sells Out! - The Information Archive
/
Group 42 Sells Out (Group 42) (1996).iso
/
hack
/
tv
/
sat
/
euro
/
picblock.lst
< prev
next >
Wrap
File List
|
1995-04-25
|
22KB
|
428 lines
16c5x/xx Cross-Assembler V4.14 Released Tue Apr 25 21:01:19 1995 Page 1
PICBLOCK
Line PC Opcode
0001 LIST P=16C84
0002 LIST F=INHX8M
0003 ;
0004 ; Decoder data --> PORTB.0
0005 ; Card data -----> PORTA.0
0006 ;
0007 0000 ORG 0
0008 ; Registers
0009 0000 IND0 EQU 0
0010 0001 TMR0 EQU 1
0011 0002 PC EQU 2
0012 0003 STATUS EQU 3
0013 0004 FSR EQU 4
0014 0005 PORTA EQU 5
0015 0006 PORTB EQU 6
0016 0006 TRISB EQU 6
0017 0008 EEDATA EQU 8
0018 0009 EEADR EQU 9
0019 0010 PCLATH EQU 10
0020 0011 INTCON EQU 11
0021 ;
0022 0012 VC_data EQU 12
0023 0013 Byte_count EQU 13
0024 0014 Bit_count EQU 14
0025 0015 Cla EQU 15
0026 0016 Ins EQU 16
0027 0017 P1 EQU 17
0028 0018 P2 EQU 18
0029 0019 Count EQU 19
0030 0020 Del EQU 20
0031 0021 SN1 EQU 21
0032 0022 SN2 EQU 22
0033 ;
0034 ; Macros
0035 0001 SAME EQU 1
0036 0002 Z EQU 2
0037
0038 0000 2879 GOTO START
0039
0040 ;********************************************************
**********************
0041 ; Read byte from card or decoder.
0042 ; Byte is passed on to decoder or card
0043 ; or card to decoder, bit by bit.
0044 ; Exits with byte in reg. data.
0045 ;********************************************************
**********************
0046 Read_byte
0047 0001 1C06 BTFSS PORTB,0 ; Wait for start bit - decoder
0048 0002 2828 GOTO To_Card ; Decoder to card com
0049 0003 1C05 BTFSS PORTA,0 ; Wait for start bit - card
0050 0004 2806 GOTO To_Dec ; Card to decoder com
16c5x/xx Cross-Assembler V4.14 Released Tue Apr 25 21:01:19 1995 Page 2
Line PC Opcode
0051 0005 2801 GOTO Read_byte ; No start bit found
0052 To_Dec
0053 0006 2072 CALL Half_delay ; Half-bit delay - center of st
art bit
0054 0007 1683 BSF STATUS,5 ; Change to page 1
0055 0008 1006 BCF TRISB,0 ; PB.0 to output - to decoder
0056 0009 1283 BCF STATUS,5 ; Back to page 0
0057 000A 1006 BCF PORTB,0 ; Send start bit to decoder
0058 000B 1805 BTFSC PORTA,0
0059 000C 2822 GOTO Stop_cd
0060 000D 3008 MOVLW 8 ; Get number of data bits
0061 000E 0094 MOVWF Bit_count ; Store it
0062 000F 0192 CLRF VC_data ; Clear data register
0063 0010 2074 CALL Bit_delay ; 1-bit delay - centre of 1st b
it
0064 0011 1003 BCF STATUS,0 ; Clear carry bit
0065 Nxt_Cbit
0066 0012 0D92 RLF VC_data,SAME ; Shift data bits left 1
0067 0013 1C05 BTFSS PORTA,0 ; Read card i/o, is it high ?
0068 0014 2818 GOTO Cbit_0 ; ...no
0069 0015 1406 BSF PORTB,0 ; Card i/o high, so send decode
r a 1
0070 0016 0A92 INCF VC_data,SAME ; Read a 1, so data LSB to 1
0071 0017 2819 GOTO Rd_Cbit ; Bit = 1
0072 Cbit_0
0073 0018 1006 BCF PORTB,0 ; Read a 0, so send decoder a 0
0074 Rd_Cbit
0075 0019 2074 CALL Bit_delay ; Wait till centre of next bit
0076 001A 0B94 DECFSZ Bit_count,SAME ; All bits read yet ?
0077 001B 2812 GOTO Nxt_Cbit ; ...no, get next bit
0078 001C 1C05 BTFSS PORTA,0 ; 8 data bits read, read parity
bit
0079 001D 1006 BCF PORTB,0 ; Parity = 0, so send decoder a
0
0080 001E 1805 BTFSC PORTA,0 ; Read parity bit again
0081 001F 1406 BSF PORTB,0 ; Parity = 1, so send decoder a
1
0082 0020 2074 CALL Bit_delay ; Wait till centre of stop bit
0083 0021 0992 COMF VC_data,SAME ; Invert data
0084 Stop_cd
0085 0022 1406 BSF PORTB,0 ; Send decoder stop bit
0086 0023 1683 BSF STATUS,5 ; Change to page 1
0087 0024 1406 BSF TRISB,0 ; PB.0 to input
0088 0025 1283 BCF STATUS,5 ; Back to page 0
0089 0026 2074 CALL Bit_delay
0090
0091 0027 0008 RETURN
0092
0093 ;********************************************************
**********************
0094 ; Decoder to card
0095 ;********************************************************
**********************
0096 0028 2072 To_Card CALL Half_delay ; Half-bit delay
- center of start bit
0097 0029 1683 BSF STATUS,5 ; Change to page 1
0098 002A 1005 BCF PORTA,0 ; PA.0 to output - to card
0099 002B 0000 NOP
0100 002C 1283 BCF STATUS,5 ; Back to page 0
16c5x/xx Cross-Assembler V4.14 Released Tue Apr 25 21:01:19 1995 Page 3
Line PC Opcode
0101 002D 1005 BCF PORTA,0 ; Send start bit to card
0102 002E 1806 BTFSC PORTB,0
0103 002F 2847 GOTO Stop_dc
0104 0030 3008 MOVLW 8 ; Get number of data bits
0105 0031 0094 MOVWF Bit_count ; Store it
0106 0032 0192 CLRF VC_data ; Clear data register
0107 0033 2074 CALL Bit_delay ; 1-bit delay - centre of 1st b
it
0108 0034 1003 BCF STATUS,0 ; Clear carry bit
0109 Nxt_Dbit
0110 0035 0D92 RLF VC_data,SAME ; Shift data bits left 1
0111 0036 0000 NOP
0112 0037 1C06 BTFSS PORTB,0 ; Read decoder i/o, is it high
?
0113 0038 283C GOTO Dbit_0 ; ... no
0114 0039 1405 BSF PORTA,0 ; Decoder i/o high, so send car
d a 1
0115 003A 0A92 INCF VC_data,SAME ; Read a 1, so data LSB to 1
0116 003B 283D GOTO Rd_Dbit ; Next bit
0117 Dbit_0
0118 003C 1005 BCF PORTA,0 ; Read a 0, so send card a 0
0119 Rd_Dbit
0120 003D 2074 CALL Bit_delay ; Wait till centre of next bit
0121 003E 0000 NOP
0122 003F 0B94 DECFSZ Bit_count,SAME ; All bits read yet ?
0123 0040 2835 GOTO Nxt_Dbit ; .. no, get next bit
0124 0041 1C06 BTFSS PORTB,0 ; 8 data bits read, read parity
bit
0125 0042 1005 BCF PORTA,0 ; Parity = 0, so send decoder a
0
0126 0043 1806 BTFSC PORTB,0 ; Read parity bit again
0127 0044 1405 BSF PORTA,0 ; Parity = 1, so send card a 1
0128 0045 2074 CALL Bit_delay ; Wait till centre of stop bit
0129 0046 0992 COMF VC_data,SAME ; Invert data
0130 Stop_dc
0131 0047 1405 BSF PORTA,0 ; Send card stop bit
0132 0048 1683 BSF STATUS,5 ; Change to page 1
0133 0049 1405 BSF PORTA,0 ; PA.0 to input
0134 004A 1283 BCF STATUS,5 ; Back to page 0
0135 004B 0008 RETURN
0136
0137 ;********************************************************
**********************
0138 ; Send 00 in place of remaining E0 string
0139 ;********************************************************
**********************
0140 Send_00
0141 004C 1806 BTFSC PORTB,0 ; Wait for start bit from decod
er
0142 004D 284C GOTO Send_00
0143 004E 2072 CALL Half_delay ; Half-bit delay - center of st
art bit
0144 004F 1683 BSF STATUS,5 ; Change to page 1
0145 0050 1005 BCF PORTA,0 ; PA.0 to output - to card
0146 0051 1085 BCF PORTA,1
0147 0052 1283 BCF STATUS,5 ; Back to page 0
0148 0053 1005 BCF PORTA,0 ; Send start bit to card
0149
0150 0054 1806 BTFSC PORTB,0
16c5x/xx Cross-Assembler V4.14 Released Tue Apr 25 21:01:19 1995 Page 4
Line PC Opcode
0151 0055 286D GOTO Stop_dc0
0152
0153 0056 3008 MOVLW 8 ; Get number of data bits
0154 0057 0094 MOVWF Bit_count ; Store it
0155 0058 0000 NOP
0156 0059 2074 CALL Bit_delay ; 1-bit delay - centre of 1st b
it
0157 005A 1003 BCF STATUS,0 ; Clear carry bit
0158 005B 0000 NEXT0 NOP ; NOPs to preserv
e bit timing
0159 005C 1485 BSF PORTA,1 ; Scope monitor bit
0160 005D 0000 NOP
0161 005E 0000 NOP
0162 005F 1405 BSF PORTA,0 ; Send card a 0 ( inverse )
0163 0060 0000 NOP
0164 0061 0000 NOP
0165 0062 0000 NOP
0166 0063 2074 CALL Bit_delay ; Wait till centre of next bit
0167 0064 1085 BCF PORTA,1 ; For scope
0168 0065 0B94 DECFSZ Bit_count,SAME ; All bits read yet ?
0169 0066 285B GOTO NEXT0 ; .. no, get next bit
0170 0067 0000 NOP
0171 0068 0000 NOP
0172 0069 0000 NOP
0173 006A 0000 NOP
0174 006B 2074 CALL Bit_delay ; Wait till centre of stop bit
0175 006C 0000 NOP
0176 Stop_dc0
0177 006D 1405 BSF PORTA,0 ; Send card stop bit
0178 006E 1683 BSF STATUS,5 ; Change to page 1
0179 006F 1405 BSF PORTA,0 ; PA.0 to input
0180 0070 1283 BCF STATUS,5 ; Back to page 0
0181 0071 0008 RETURN
0182
0183 ;********************************************************
**********************
0184 ; Delay for 48uS or 89uS
0185 ;********************************************************
**********************
0186 Half_delay
0187 0072 300E MOVLW 0xE
0188 0073 2875 GOTO Delay
0189
0190 Bit_delay
0191 0074 301A MOVLW 0x1A
0192 Delay
0193 0075 00A0 MOVWF Del
0194 Del_loop
0195 0076 0BA0 DECFSZ Del,SAME
0196 0077 2876 GOTO Del_loop
0197 0078 0008 RETURN
0198 ;********************************************************
*********************
0199 ; Start of program
0200 ;********************************************************
*********************
16c5x/xx Cross-Assembler V4.14 Released Tue Apr 25 21:01:19 1995 Page 5
Line PC Opcode
0201 0079 0195 START CLRF Cla
0202 007A 0196 CLRF Ins
0203 007B 0197 CLRF P1
0204 007C 0198 CLRF P2
0205
0206 ;******************************** Main program loop *****
*********************
0207 MAIN
0208 007D 0816 MOVF Ins,W
0209 007E 0095 MOVWF Cla
0210 007F 0817 MOVF P1,W
0211 0080 0096 MOVWF Ins
0212 0081 0818 MOVF P2,W
0213 0082 0097 MOVWF P1
0214 0083 2001 CALL Read_byte
0215 0084 0812 MOVF VC_data,W
0216 0085 0098 MOVWF P2
0217 0086 1D03 BTFSS STATUS,Z ; Check P2 = 0
0218 0087 287D GOTO MAIN
0219 0088 0815 MOVF Cla,W
0220 0089 3A53 XORLW 0x53 ; Check for Vcrypt class code
0221 008A 1D03 BTFSS STATUS,Z
0222 008B 287D GOTO MAIN ; Loop round until class 53h fo
und
0223 008C 0897 MOVF P1,SAME
0224 008D 1D03 BTFSS STATUS,Z ; Check for P1 = 0
0225 008E 287D GOTO MAIN ; Not header - try again
0226 008F 2001 CALL Read_byte ; Read byte count
0227 0090 0812 MOVF VC_data,W
0228 0091 0093 MOVWF Byte_count ; Store byte count
0229 0092 0A93 INCF Byte_count,SAME
0230 0093 2001 CALL Read_byte ; Transfer ins back
0231 0094 3074 MOVLW 0x74 ; Instruction 74h ?
0232 0095 0616 XORWF Ins,W
0233 0096 1903 BTFSC STATUS,Z
0234 0097 2899 GOTO Ins74
0235 0098 287D GOTO MAIN
0236
0237 ;************** Instruction code 74h - message from stati
on *****************
0238 Ins74
0239 0099 301F MOVLW 0x1F
0240 009A 0099 MOVWF Count
0241 009B 2001 CALL Read_byte ; Read 1st byte
0242 009C 1D92 BTFSS VC_data,3 ; Check for E8 or E0 1st byte
0243 009D 28A2 GOTO block
0244 No_block
0245 009E 2001 CALL Read_byte ; Read/send remaining 31 bytes
0246 009F 0B99 DECFSZ Count,SAME
0247 00A0 289E GOTO No_block
0248 00A1 287D GOTO MAIN
0249 block
0250 00A2 300A MOVLW 0xA
16c5x/xx Cross-Assembler V4.14 Released Tue Apr 25 21:01:19 1995 Page 6
Line PC Opcode
0251 00A3 0099 MOVWF Count
0252 block10
0253 00A4 2001 CALL Read_byte ; Read/send 1st 10 bytes
0254 00A5 0B99 DECFSZ Count,SAME
0255 00A6 28A4 GOTO block10
0256 00A7 2001 CALL Read_byte ; Get E0 S/N 5th digit (1)
0257 00A8 0812 MOVF VC_data,W
0258 00A9 00A1 MOVWF SN1
0259 00AA 2001 CALL Read_byte ; Get E0 S/N 5th digit (2)
0260 00AB 0812 MOVF VC_data,W
0261 00AC 00A2 MOVWF SN2
0262 00AD 2001 CALL Read_byte ; Get E0 S/N 5th digit (3)
0263 00AE 0812 MOVF VC_data,W
0264 00AF 06A2 XORWF SN2,SAME
0265 00B0 1D03 BTFSS STATUS,Z ; Does digit 3 = digit 2 ?
0266 00B1 28BB GOTO E0_ok
0267 00B2 06A1 XORWF SN1,SAME
0268 00B3 1D03 BTFSS STATUS,Z ; Does digit 3 = digit 1 ?
0269 00B4 28BB GOTO E0_ok
0270 ; 3 consecutive bytes are the same
0271 00B5 3012 MOVLW 0x12 ; 18 bytes left in E0 string
0272 00B6 0099 MOVWF Count
0273 Kill_E0
0274 00B7 204C CALL Send_00 ; Kill remaining 18 bytes
0275 00B8 0B99 DECFSZ Count
0276 00B9 28B7 GOTO Kill_E0
0277 00BA 287D GOTO MAIN
0278 E0_ok
0279 00BB 3012 MOVLW 0x12 ; 18 bytes left in E0 string
0280 00BC 0099 MOVWF Count
0281 No_kill
0282 00BD 2001 CALL Read_byte ; Pass on remaining 18 bytes
0283 00BE 0B99 DECFSZ Count
0284 00BF 28BD GOTO No_kill
0285 00C0 287D GOTO MAIN
0286
0287 0000 END
16c5x/xx Cross-Assembler V4.14 Released Tue Apr 25 21:01:19 1995 Page 7
Cross-Reference Listing
LABEL VALUE DEFN REFERENCES
Bit_count 20 24 24 61 76 105 122 154
168
Bit_delay 116 190 63 75 82 89 107 120
128 156 166 174 190
Byte_count 19 23 23 228 229
Cbit_0 24 72 68 72
Cla 21 25 25 201 209 219
Count 25 29 29 240 246 251 254 272
275 280 283
Dbit_0 60 117 113 117
Del 32 30 30 193 195
Del_loop 118 194 194 196
Delay 117 192 188 192
E0_ok 187 278 266 269 278
EEADR 9 18 18
EEDATA 8 17 17
FSR 4 13 13
Half_delay 114 186 53 96 143 186
IND0 0 9 9
INTCON 17 20 20
Ins 22 26 26 202 208 211 232
Ins74 153 238 234 238
Kill_E0 183 273 273 276
MAIN 125 207 207 218 222 225 235 248
277 285
NEXT0 91 158 158 169
No_block 158 244 244 247
No_kill 189 281 281 284
Nxt_Cbit 18 65 65 77
Nxt_Dbit 53 109 109 123
P1 23 27 27 203 210 213 223
P2 24 28 28 204 212 216
PC 2 11 11
PCLATH 16 19 19
PORTA 5 14 14 49 58 67 78 80
98 101 114 118 125 127
131 133 145 146 148 159
162 167 177 179
PORTB 6 15 15 47 57 69 73 79
81 85 102 112 124 126
141 150
Rd_Cbit 25 74 71 74
Rd_Dbit 61 119 116 119
Read_byte 1 46 46 51 214 226 230 241
245 253 256 259 262 282
SAME 1 35 35 66 70 76 83 110
115 122 129 168 195 223
229 246 254 264 267
SN1 33 31 31 258 267
SN2 34 32 32 261 264
START 121 201 38 201
STATUS 3 12 12 54 56 64 86 88
97 100 108 132 134 144
147 157 178 180 217 221
224 233 265 268
Send_00 76 140 140 142 274
Stop_cd 34 84 59 84
Stop_dc 71 130 103 130
Stop_dc0 109 176 151 176
TMR0 1 10 10
TRISB 6 16 16 55 87
To_Card 40 96 48 96
To_Dec 6 52 50 52
VC_data 18 22 22 62 66 70 83 106
110 115 129 215 227 242
257 260 263
Z 2 36 36 217 221 224 233 265
268
block 162 249 243 249
block10 164 252 252 255